<div class='span12'>
    <!-- HEADER -->
    <div class='row-fluid'>
        <div class='span12'>
            <div class='page-header'>

                <h1 class="span8">
                    <i class='icon-bullhorn'></i>
                    <span>CATEGORY</span>
                </h1>
                <div class="span4 text-right">
                    <a href="<?= URL::to('category/admin/home/create/'.$pid);?>" class="btn btn-large btn-inverse">Create New</a>
                </div>
            </div>
        </div>
    </div>

    <!-- END OF HEADER -->


    <div class='row-fluid'>
        <div class="span12 box bordered-box blue-border" style="margin-bottom:0;">
            <div class="box-header blue-background">
                <div class="title">List of Category</div>
                <div class="actions">
                    <a href="#" class="btn box-remove btn-mini btn-link"><i class="icon-remove"></i>
                    </a>
                    <a href="#" class="btn box-collapse btn-mini btn-link"><i></i>
                    </a>
                </div>
            </div>
            <div class="box-content box-no-padding">
                <div class="responsive-table">
                    <div class="scrollable-area">
                        <table class="table" style="margin-bottom:0;">
                            <?php if($parent){?>
                            <thead>
                            <tr>
                                <th>
                                    Title
                                </th>
                                <th>
                                   Icon
                                </th>
                                <th>
                                    Status
                                </th>
                                <th></th>
                            </tr>
                            </thead>
                            <tbody>

                            <?php foreach($parent as $cat):?>
                            <tr>

                                <td>
                                
                                <?= $cat->name;?>
                                
                                </td>
                                <td>
                              <?php if($cat->icon){?>  <i class="fa <?= $cat->icon ;?> fa-2x pull-left fa-border fa-yellow"></i><?php }?>
                                </td>
                                <td>


                                    <?php if($cat->status == 51){?>
                                    <span class="label label-important">Active</span>
                                    <?php }else{ ?>
                                    <span class="label label-success">Inactive</span>
                                    <?php } ?>
                                </td>
                                <td>
                                    <div class="text-right">
                                    	
                                    <?php if($cat->parent_id != 0){?>	
                                      <a class="btn btn-info btn-mini" href="<?= URL::to("category/admin");?>" title="Back to previous">
                                            <i class="icon-mail-reply"></i>
                                        </a>
                                        <?php }?>
                                    
                                    
                                        <a class="btn btn-info btn-mini" href="<?= URL::to("category/admin/home/child/$cat->id");?>" title="Next Level">
                                            <i class="icon-share-alt"></i>
                                        </a>

                                        <a class="btn btn-success btn-mini" href="<?= URL::to("category/admin/home/edit/$cat->id");?>" title="Edit"
                                        >
                                            <i class="icon-edit"></i>
                                        </a>
                                        <a class="btn btn-danger btn-mini" href="<?= URL::to("category/admin/home/delete/$cat->id");?>" title="Delete"
                                        <?php if(Config::get('application.mode')){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" 
                                        <?}else{?>onclick="return confirm('Are you sure ?');"<?php }?>
                                        >
                                            <i class="icon-remove"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
 
                            <?php endforeach;?>



                            </tbody>
                            <?php }else{?>
                              <div class="alert alert-danger">No data found..</div>
                            <?php }?>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <!-- END OF CONTENT -->
</div>



